From: Ewan Mellor Date: Mon, 25 Dec 2006 17:02:16 +0000 (+0000) Subject: Persist the VLAN setting. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15422^2~155 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=686cfca86ad69c375b2fe8e5a881109bcc4f8b14;p=xen.git Persist the VLAN setting. Signed-off-by: Ewan Mellor --- diff --git a/tools/python/xen/xend/XendNode.py b/tools/python/xen/xend/XendNode.py index 5033818045..4bd2d7ec01 100644 --- a/tools/python/xen/xend/XendNode.py +++ b/tools/python/xen/xend/XendNode.py @@ -107,6 +107,7 @@ class XendNode: self.pifs[pif_uuid] = XendPIF(pif_uuid, pif['name'], pif['MTU'], + pif['VLAN'], pif['MAC'], network, self) @@ -114,7 +115,7 @@ class XendNode: for name, mtu, mac in linux_get_phy_ifaces(): network = self.networks.values()[0] pif_uuid = uuid.createString() - pif = XendPIF(pif_uuid, name, mtu, mac, network, self) + pif = XendPIF(pif_uuid, name, mtu, '', mac, network, self) self.pifs[pif_uuid] = pif # initialise storage diff --git a/tools/python/xen/xend/XendPIF.py b/tools/python/xen/xend/XendPIF.py index 32c4b3626b..c3aed06427 100644 --- a/tools/python/xen/xend/XendPIF.py +++ b/tools/python/xen/xend/XendPIF.py @@ -99,12 +99,12 @@ def same_dir_rename(old_path, new_path): class XendPIF: """Representation of a Physical Network Interface.""" - def __init__(self, uuid, name, mtu, mac, network, host): + def __init__(self, uuid, name, mtu, vlan, mac, network, host): self.uuid = uuid self.name = name self.mac = mac self.mtu = mtu - self.vlan = '' + self.vlan = vlan self.network = network self.host = host @@ -132,11 +132,11 @@ class XendPIF: def get_record(self, transient = True): result = {'name': self.name, 'MAC': self.mac, - 'MTU': self.mtu, + 'MTU': str(self.mtu), 'VLAN': self.vlan, 'host': self.host.uuid, 'network': self.network.uuid} if transient: - result['io_read_kbs'] = self.get_io_read_kbs() - result['io_write_kbs'] = self.get_io_write_kbs() + result['io_read_kbs'] = str(self.get_io_read_kbs()) + result['io_write_kbs'] = str(self.get_io_write_kbs()) return result